# import sys
# sys.path.insert(0, '../../../')
#
# import os
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'focus_on_rent.settings.dev')
#
# import django
# django.setup()
# from focus_on_rent.settings import dev
# from django.conf import settings
# from django.template import loader
# from homes.models import House
#
#
# def generate_index_html():
#
#     obj_houses = House.objects.all()
#     show_list = []
#
#     for house in obj_houses:
#         show_list.append({
#             'house_id': house.id,
#             'img_url': dev.QINIU_URL + house.index_image_url,
#             'title': house.title
#         })
#     context = {'context':show_list}
#
#     template = loader.get_template('index.html')
#     html_text = template.render(context)
#
#     file_path = os.path.join(settings.GENERATED_STATIC_HTML_FILES_DIR, 'index.html')
#
#     with open(file_path, 'w', encoding='utf-8') as f:
#         f.write(html_text)
#
#
# if __name__ == '__main__':
#     generate_index_html()